-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix attachment detection #197
base: main
Are you sure you want to change the base?
Conversation
Hmm. This seems to be RFC 5987 encoding, but that's intended for HTTP only. I wonder how common this is in emails? There is also RFC 2231, which should use |
Yep, this what I've describe but unfortunately some apps use this syntax, at least mail.app on MacOS, and iPhone Mail on iOS which are a major mail clients. |
So it seems.. I guess it could be worth it then. Thanks, I'll add this to our internal Jira. |
I'm actually wondering now whether we should fully support decoding the parameter in lib-mail, similar to how rfc2231_parse() works now. It converts the |
Tracking this internally in DOP-3186 |
@sirainen it's up to you to choose the better way to manage this issue. Maybe this could also be a slight update un the existing rfc2231 parse method ? For now my proposal, which I know is not perfect, but its the one with the lowest impact on the codebase on my opinion. |
Any updates on this? I can't search for any mails with attachments because of this. |
Hi there,
Description
Attachment detection on specific case do not works as expected (inline attachment with encoded filename)
How to reproduce
Tested on latest dovecot version 2.3.20 with the following option:
mail_attachment_detection_options = add-flags-on-save
Description of the issue
In some case mime-part could have encoded header parameters. It was originally define in the RFC 5987
https://datatracker.ietf.org/doc/html/rfc5987 for the http headers but some applications use it in mime context.
For example Mail.app, adding an inline attachment named "Capture d’écran 2023-05-03 à 11.11.51.png" will produce this kind of part headers:
Attachment detection for inline part defined in the lib-mail/message-part-data was strict on the header parameter and only
check for the parameter==="filename".
The fix
I've simply add another condition on the inline attachment detection to handle encoded "filename"